<?php echo $this->Html->script('user_globel'); ?>
<div id="content">
  <!--  start page-heading -->
  <div id="page-heading">
      <h1><?php echo __('Help Desk'); ?></h1>
  </div>
	<!-- end page-heading -->
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
    	<tr>
      		<th rowspan="3" class="sized">
              <?php echo $this->Html->image('/images/shared/side_shadowleft.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
          </th>
      		<th class="topleft"></th>
      		<td id="tbl-border-top">&nbsp;</td>
      		<th class="topright"></th>
      		<th rowspan="3" class="sized">
              <?php echo $this->Html->image('/images/shared/side_shadowright.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
          </th>
    	</tr>
    	<tr>
		      <td id="tbl-border-left"></td>
		      <td>
		<!--  start content-table-inner ...................................................................... START -->
		          <div id="content-table-inner">
		
			<!--  start table-content  -->
          			<div id="table-content">
           	       <div id="page-heading1"></div>   

                      <ol class="commentlist">
                          <li class="comment even thread-even depth-1" id="comment-1521">
                          			<p class="comment-author">
                          				<span><?php echo $enquiry['Enquiry']['name']; ?></span><br>
                          				<small class="comment-time">
                                      <strong><?php echo date('d/m/Y h:i A', strtotime($enquiry['Enquiry']['created'])); ?></strong>
                                  </small>
                          			</p>
                          			<div class="commententry">
                          							
                          				<p><?php echo $enquiry['Enquiry']['query']; ?></p>
                          			</div>
                          			<!--<p class="reply reply-button">Reply</p>-->
                               <?php if(!empty($enquiry['EnquiryReply'])){ ?>
                                		<ul class="children">
                                    <?php foreach($enquiry['EnquiryReply'] as $value): ?>
                                    		<li class="comment odd alt depth-2" id="comment">
                                    			<p class="comment-author">
                                    				<span><?php echo $value['user']; ?></span><br>
                                    				<small class="comment-time">
                                                <strong><?php echo date('d/m/Y h:i A', strtotime($value['created'])); ?></strong>
                                            </small>
                                    			</p>
                                    			<div class="commententry">
                                    				<p><?php echo $value['reply']; ?></p>
                                    			</div>
                                    		</li>
                                    <?php endforeach; ?>
                                    </ul>
                               <?php } ?>
                               <li>
                                   <div id="respond">
                                       <h3>Reply</h3>
                                       <?php echo $this->Form->create('Ticket', array('action' => 'query_reply')); ?>
                                       <?php echo $this->Form->input('enquiry_id', array('type' => 'hidden', 'value' => $enquiry['Enquiry']['id'])); ?>
                                       <?php echo $this->Form->input('reply', array('type' => 'textarea', 'div' => false, 'label' => false, 'style' => 'width:500px;margin-bottom:10px;')); ?>
                                       <?php echo $this->Form->submit('Submit', array('class' => 'submit-button')); ?>
                                       <?php echo $this->Form->end(); ?>
                                   </div>
                               </li>     
                          </li>
                      </ol>


		<!--  end trainer-table................................... --> 
			
      </div>
			<!--  end content-table  -->
		

			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>


<style> 

#respond {
  margin: 40px 0 30px;
  padding: 10px 0 0;
  position: relative;
  clear: both;
}
textarea {
  background: #fff;
  border: solid 1px #ddd;
  padding: 5px 10px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  -webkit-appearance: none;
  -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}
.commentlist {
  margin: 0;
  padding: 5px 0 0;
  border-top: solid 1px #ddd;
  width: 70%;
}
ul, ol {
  line-height: 140%;
  list-style: none outside none;
  padding: 0;
}
.commentlist li {
  margin: 0;
  padding: 15px 0 0;
  list-style: none;
  position: relative;
}
.commentlist .comment-author {
  margin: 2px 0 5px;
  padding: 0;
}
.commentlist .comment-time {
  font-size: 75%;
  text-transform: uppercase;
}
.commentlist .commententry {
  border-bottom: solid 1px #ddd;
  position: relative;
  min-height: 40px;
  overflow: hidden;
  padding-bottom: 5px;
  word-wrap: break-word;
}
p {
  margin: 0 0 1.2em;
  padding: 0;
  font-size: 14px !important;
}
.commentlist .reply {
  position: absolute;
  right: 10px;
  top: 16px;
}
.commentlist ul, .commentlist ol {
  margin: 0 0 0 90px;
  padding: 0;
}
.commentlist li {
  margin: 0;
  padding: 15px 0 0;
  list-style: none;
  position: relative;
}

</style>
